package org.learn.test;

public class Array01 {
    public static void main(String[] args) {
         //数组的引出
        //n个个体的平均体重和总体重

        double totalWeight = 0;
         double[] hens = {3, 5, 1, 3.4, 2, 50};
         System.out.println("数组的长度=" + hens.length);
         for( int i = 0; i < 6; i++){
             //System.out.println("第" + (i+1) + "个元素的值" + hens[i]);
             totalWeight += hens[i];
         }
         System.out.println("总体重=" + totalWeight +
                 "平均体重=" + (totalWeight / hens.length));
    }


}
